package com.bacon.gmall.item.config;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author： bacon、
 * @version： 1.0
 * @create： 2020-12-26 13:18
 * @description:
 */
@Component
public class ThreadConfig {

    @Bean
    ThreadPoolExecutor threadPoolExecutor() {
        return new ThreadPoolExecutor(
                10,
                20,
                60,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(20)
        );
    }
}
